package controller;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import service.Impl.CategoryServiceImpl;
import util.ResultUtil;

import java.io.IOException;
@WebServlet("/admin/category/del")
public class CategoryDelController extends HttpServlet {
    @Override
    protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        CategoryServiceImpl service=new CategoryServiceImpl();
        service.Del(Integer.parseInt(req.getParameter("id")));
        String json= ResultUtil.getJSON(null);
        resp.getWriter().write(json);
    }
}
